package com.mybatis.criteria;

import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.util.StringUtils;

public class MyEntityCriteria extends MyCriteria {

    private MyEntityCriteria(Boolean isContain) {
        super(isContain);
    }

    @Override
    public String getSqlSegment() {
         /*
         * 无条件
         */
        String sqlWhere = sql.toString();
        if (StringUtils.isEmpty(sqlWhere)) {
            return null;
        }
        return sqlWhere;
    }

    public static  MyCriteria build() {
        return new MyEntityCriteria(false);
    }
}
